
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>1. QWidget的概念 · GitBook</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="3.2.html" />
    
    
    <link rel="prev" href="../README_3.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    Qt入门教程笔记
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../Chapter1/">
            
                <a href="../Chapter1/">
            
                    
                    一. Qt和qmake的配置
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="../Chapter1/1.1.html">
            
                <a href="../Chapter1/1.1.html">
            
                    
                    1. Qmake项目原理和手动配置Qtcreater
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="../Chapter1/1.2.html">
            
                <a href="../Chapter1/1.2.html">
            
                    
                    2. Qmake创建动态和静态链接库
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3" data-path="../Chapter1/1.3.html">
            
                <a href="../Chapter1/1.3.html">
            
                    
                    3. Qmake的版本设置
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../README_2.html">
            
                <a href="../README_2.html">
            
                    
                    二. Qt信号槽机制
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="../Chapter2/2.1.html">
            
                <a href="../Chapter2/2.1.html">
            
                    
                    1. Qt信号槽的概念
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="../README_3.html">
            
                <a href="../README_3.html">
            
                    
                    三. QWidget的概念和使用
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter active" data-level="1.4.1" data-path="3.1.html">
            
                <a href="3.1.html">
            
                    
                    1. QWidget的概念
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="3.2.html">
            
                <a href="3.2.html">
            
                    
                    2. QWidget的使用
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="../README_4.html">
            
                <a href="../README_4.html">
            
                    
                    四. QString字符串类型
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="../Chapter4/4.1.html">
            
                <a href="../Chapter4/4.1.html">
            
                    
                    1. QString概述
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="../Chapter4/4.2.html">
            
                <a href="../Chapter4/4.2.html">
            
                    
                    2. QString方法
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="../README_5.html">
            
                <a href="../README_5.html">
            
                    
                    五. QLabel
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="../Chapter5/5.1.html">
            
                <a href="../Chapter5/5.1.html">
            
                    
                    1. QLabel的概念
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2" data-path="../Chapter5/5.2.html">
            
                <a href="../Chapter5/5.2.html">
            
                    
                    2. QLabel的创建和方法
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="../README_6.html">
            
                <a href="../README_6.html">
            
                    
                    六. QPushButton
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.1" data-path="../Chapter6/6.1.html">
            
                <a href="../Chapter6/6.1.html">
            
                    
                    1. QPushButton的概念
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >1. QWidget的概念</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="1-qwidget&#x7684;&#x6982;&#x5FF5;">1. QWidget&#x7684;&#x6982;&#x5FF5;</h1>
<h2 id="1-qwidget&#x7684;&#x91CD;&#x8981;&#x6027;">1. QWidget&#x7684;&#x91CD;&#x8981;&#x6027;</h2>
<ul>
<li>QWidget&#x662F;Qt&#x4E2D;&#x6240;&#x6709;&#x7528;&#x6237;&#x754C;&#x9762;&#x5BF9;&#x8C61;&#x7684;&#x57FA;&#x7C7B;</li>
<li>QWidget&#x7684;&#x7A97;&#x770B;&#x4E0D;&#x89C1;&#x63A5;&#x53D7;&#x9F20;&#x6807;&#x952E;&#x76D8;&#x7B49;&#x4E8B;&#x4EF6;</li>
<li>&#x53EF;&#x4EE5;&#x901A;&#x8FC7;&#x5C4F;&#x5E55;&#x4E0A;&#x7ED8;&#x5236;&#x81EA;&#x5DF1;</li>
<li>&#x7236;&#x5B50;&#x5173;&#x7CFB;&#x6709;&#x76F8;&#x5BF9;&#x5750;&#x6807;<blockquote>
<p>&#x5750;&#x6807;: &#x5DE6;&#x4E0A;&#x89D2;&#x662F;(0,0),&#x6A2A;&#x7740;&#x662F;x&#x8F74;,&#x7EB5;&#x8F74;&#x662F;y&#x8F74;.\
&#x7EDD;&#x5BF9;&#x5750;&#x6807;: &#x5BF9;&#x8C61;&#x5728;&#x7A97;&#x53E3;&#x4E0A;&#x7684;&#x5750;&#x6807;\
&#x76F8;&#x5BF9;&#x5750;&#x6807;: &#x5BF9;&#x8C61;&#x76F8;&#x5BF9;&#x4E8E;&#x7236;&#x7C7B;&#x7684;&#x5750;&#x6807;.(&#x6BD4;&#x5982;&#x5F53;&#x7A97;&#x53E3;&#x79FB;&#x52A8;&#x65F6;,&#x5B50;&#x90E8;&#x4EF6;&#x6700;&#x597D;&#x7528;&#x76F8;&#x5BF9;&#x5750;&#x6807;&#x5B9A;&#x4F4D;)</p>
</blockquote>
</li>
</ul>
<p>```## 2. QThread
&#x521B;&#x5EFA;&#x4E00;&#x4E2A;&#x7EBF;&#x7A0B;</p>
<ul>
<li>&#x521B;&#x5EFA;&#x4E00;&#x4E2A;&#x7C7B;,&#x8BE5;&#x7EBF;&#x7A0B;&#x63A5;&#x53E3;&#x96C6;&#x6210;QThread</li>
<li>void run(){}//&#x91CD;&#x8F7D;&#x7EBF;&#x7A0B;&#x5904;&#x7406;&#x51FD;&#x6570;</li>
<li>void start(){}//&#x7EBF;&#x7A0B;&#x542F;&#x52A8;&#x51FD;&#x6570;</li>
</ul>
<h2 id="3-&#x624B;&#x52A8;&#x521B;&#x5EFA;qwidget&#x5BF9;&#x8C61;">3. &#x624B;&#x52A8;&#x521B;&#x5EFA;QWidget&#x5BF9;&#x8C61;</h2>
<ul>
<li>QWidget w;//&#x521B;&#x5EFA;&#x72EC;&#x7ACB;&#x7A97;&#x4F53;</li>
<li>w.show();//&#x663E;&#x793A;&#x5305;&#x542B;&#x5B50;&#x7A97;&#x53E3;,&#x662F;&#x69FD;&#x51FD;&#x6570;,&#x53EA;&#x80FD;&#x5728;&#x4E3B;&#x7EBF;&#x7A0B;&#x4E2D;&#x8C03;&#x7528;</li>
<li>w.hide();//&#x9690;&#x85CF;&#x5305;&#x542B;&#x5B50;&#x7A97;&#x53E3;,&#x662F;&#x69FD;&#x51FD;&#x6570;</li>
</ul>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="../README_3.html" class="navigation navigation-prev " aria-label="Previous page: 三. QWidget的概念和使用">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="3.2.html" class="navigation navigation-next " aria-label="Next page: 2. QWidget的使用">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"1. QWidget的概念","level":"1.4.1","depth":2,"next":{"title":"2. QWidget的使用","level":"1.4.2","depth":2,"path":"Chapter3/3.2.md","ref":"Chapter3/3.2.md","articles":[]},"previous":{"title":"三. QWidget的概念和使用","level":"1.4","depth":1,"path":"README_3.md","ref":"README_3.md","articles":[{"title":"1. QWidget的概念","level":"1.4.1","depth":2,"path":"Chapter3/3.1.md","ref":"Chapter3/3.1.md","articles":[]},{"title":"2. QWidget的使用","level":"1.4.2","depth":2,"path":"Chapter3/3.2.md","ref":"Chapter3/3.2.md","articles":[]}]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":["livereload"],"pluginsConfig":{"livereload":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"Chapter3/3.1.md","mtime":"2019-06-05T07:31:56.833Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-07-07T12:23:15.547Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-livereload/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

